package com.example.news.mapper;

import com.example.news.pojo.Book;
import com.example.news.pojo.Category;
import com.example.news.pojo.Publisher;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface BookMapper {
    List<Book> getAllBooks(@Param("currentPage") Integer currentPage, @Param("publisherId") Integer publisherId);
    List<Publisher> getAllPublisher();
    List<Category> getAllCategory();
    Integer addBookInfo(@Param("book") Book book);
    Integer addBookRelationInfo(@Param("bookId") Integer bookId, @Param("categoryIdList") List<Integer> categoryIdList);
    Book findBookById(Integer bookId);
    Integer delBookRelationInfo(Integer bookId);
    Integer updateBookInfo(Book book);
}
